import { App } from "vue";
import { useUserInfoStore } from '../store/useStore'

export function permission(app: App<Element>) {
    app.directive(
        'permission', {
        mounted(el, binding) {
            const useUserInfo = useUserInfoStore()
            if (!useUserInfo.getPermission.includes(binding.value)) {
                el.remove()
            }
        }
    })
}
